package fr.vvins.core.user.entity;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import fr.vvins.core.dao.EntityImpl;

/**
 * UserCommunity entity
 */
@Entity

@Table(schema="vvins", name="VV_USER_COMMUNITY")
public class UserCommunity extends EntityImpl implements Serializable {

	private static final long serialVersionUID = 8873516510703636108L;
	@Id
	@GeneratedValue
	@Column(name="ID")
	private Integer id;
	@ManyToOne
	@JoinColumn(name="USER_ID")
	private User user;
	@ManyToOne
	@JoinColumn(name="COMMUNITY_ID")
	private Community community;
	@Basic
	@Column(name="USER_COMMUNITY_TOKEN")
	private String userCommunityToken;

	public UserCommunity() {
	}

	public UserCommunity(Integer id, User user, Community community,
			String userCommunityToken) {
		super();
		this.id = id;
		this.user = user;
		this.community = community;
		this.userCommunityToken = userCommunityToken;
	}

	@Override
	public Integer getId() {
		return id;
	}

	@Override
	public void setId(Integer id) {
		this.id = id;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Community getCommunity() {
		return community;
	}

	public void setCommunity(Community community) {
		this.community = community;
	}

	public String getUserCommunityToken() {
		return userCommunityToken;
	}

	public void setUserCommunityToken(String userCommunityToken) {
		this.userCommunityToken = userCommunityToken;
	}

	
}
